app
.controller('formSelfCtrl', ['$scope', '$http', FormSelfController]);
function FormSelfController($scope, $http){
	$scope.changeValueMap = function(field) {
		var housingPfBase = parseFloat($scope.valueMap['housingPfBase']); // 公积金基数
		var pfRatioUnit = parseFloat($scope.valueMap['pfRatioUnit']); // 养老保险比例（单位）
		var pfRatioIndividual = parseFloat($scope.valueMap['pfRatioIndividual']); // 养老保险比例（个人）
		if( (housingPfBase || housingPfBase==0 )
			&&  (pfRatioUnit || pfRatioUnit==0 )
			&&  (pfRatioIndividual || pfRatioIndividual==0 )  ) {
			// 公积金（单位）/月
			var pfUnitMonth = (housingPfBase * (pfRatioUnit/100)).toFixed(2) ;
			$scope.valueMap['pfUnitMonth'] = pfUnitMonth;
			//公积金（个人）/月
			var pfIndividualMonth = (housingPfBase * (pfRatioIndividual/100)).toFixed(2);
			$scope.valueMap['pfIndividualMonth'] = pfIndividualMonth;
		}
	}
}

